<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>资讯界面</title>

</head>
<body>
    <center><h1>资讯</h1></center>

    {% for a in list %}
        {% if a.state == 1 %}
        <h3>标题:{{ a.title }}</h3>
	        <h4>预览:{{a.content}}</h4>
        <a href='/look/{{ a.id }}'><button type='submit'>查看</button></a>
        <a href='/change/{{a.id}}'><button type='submit'>修改</button></a>
        <button type='button' onclick=q({{a.id}})>删除</button><br>
        {% endif %}

    {% endfor %}
    <a href="/Z2/"><button type="submit">发布</button></a>
    <script>
			function q(id){
				t=confirm('确定吗')
				if(t){
					location.href='http://localhost:8000/del_handler/'+id
				}
			}
		</script>
</body>
</html>
